﻿///////////////////////////////////////////////////////////////
// This is generated code. If you modify this code, be aware
// of the fact that when you re-generate the code, your changes
// are lost. If you want to keep your changes, make this file read-only
// when you have finished your changes, however it is recommended that
// you inherit from this class to extend the functionality of this generated
// class or you modify / extend the templates used to generate this code.
//////////////////////////////////////////////////////////////
// Code is generated using LLBLGen Pro version: 1.0.2005.1
// Code is generated on: October 21, 2008 12:02:14 AM
// Code is generated using templates: C# template set for SqlServer (1.0.2005.1)
// Templates vendor: Solutions Design.
// Templates version: 1.0.2005.1.111705
//////////////////////////////////////////////////////////////
using System;
using System.Collections;
using Ultimate.DAL.EntityClasses;
using Ultimate.DAL.HelperClasses;

using Ultimate.DAL.CollectionClasses;

using SD.LLBLGen.Pro.ORMSupportClasses;

namespace Ultimate.DAL.FactoryClasses
{
	
	// __LLBLGENPRO_USER_CODE_REGION_START AdditionalNamespaces
	// __LLBLGENPRO_USER_CODE_REGION_END

	
	/// <summary>Factory to create new, empty Aspnet_UsersEntity objects.</summary>
	[Serializable]
	public partial class Aspnet_UsersEntityFactory : IEntityFactory
	{
		/// <summary>Creates a new, empty Aspnet_UsersEntity object.</summary>
		/// <returns>A new, empty Aspnet_UsersEntity object.</returns>
		public virtual IEntity Create()
		{
			IEntity toReturn = new Aspnet_UsersEntity(new PropertyDescriptorFactory(), this);
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewAspnet_Users
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;

		}
		
		/// <summary>Creates a new Aspnet_UsersEntity instance but uses a special constructor which will set the Fields object of the new
		/// IEntity instance to the passed in fields object. Implement this method to support multi-type in single table inheritance.</summary>
		/// <param name="fields">Populated IEntityFields object for the new IEntity to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields object) IEntity object</returns>
		public virtual IEntity Create(IEntityFields fields)
		{
			IEntity toReturn = Create();
			toReturn.Fields = fields;
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewAspnet_UsersUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}

		/// <summary>Creates, using the generated EntityFieldsFactory, the IEntityFields object for the entity to create. This method is used by internal code to create the fields object to store fetched data. 
		/// </summary>
		/// <returns>Empty IEntityFields object.</returns>
		public virtual IEntityFields CreateFields()
		{
			return EntityFieldsFactory.CreateEntityFieldsObject(Ultimate.DAL.EntityType.Aspnet_UsersEntity);
		}
		
		/// <summary>Creates the hierarchy fields for the entity to which this factory belongs.</summary>
		/// <returns>IEntityFields object with the fields of all the entities in teh hierarchy of this entity or the fields of this entity if the entity isn't in a hierarchy.</returns>
		public virtual IEntityFields CreateHierarchyFields()
		{
			return this.CreateFields();
		}
		
		/// <summary>Creates the relations collection to the entity to join all targets so this entity can be fetched. </summary>
		/// <returns>null if the entity isn't in a hierarchy of type TargetPerEntity, otherwise the relations collection needed to join all targets together to fetch all subtypes of this entity and this entity itself</returns>
		public virtual IRelationCollection CreateHierarchyRelations()
		{
			return null;			
		}

		/// <summary>This method retrieves, using the InheritanceInfoprovider, the factory for the entity represented by the values passed in.</summary>
		/// <param name="fieldValues">Field values read from the db, to determine which factory to return, based on the field values passed in.</param>
		/// <param name="entityFieldStartIndexesPerEntity">indexes into values where per entity type their own fields start.</param>
		/// <returns>the factory for the entity which is represented by the values passed in.</returns>
		public virtual IEntityFactory GetEntityFactory(object[] fieldValues, Hashtable entityFieldStartIndexesPerEntity)
		{
			return this;
		}
		
		/// <summary>Creates a new entity collection for the entity of this factory.</summary>
		/// <returns>ready to use new entity collection, typed.</returns>
		public virtual IEntityCollection CreateEntityCollection()
		{
			return new Aspnet_UsersCollection();
		}
		
		/// <summary>returns the name of the entity this factory is for, e.g. "EmployeeEntity"</summary>
		public virtual string ForEntityName 
		{ 
			get { return "Aspnet_UsersEntity"; }
		}

		#region Included Code

		#endregion
	}
	
	/// <summary>Factory to create new, empty Cs_UsersEntity objects.</summary>
	[Serializable]
	public partial class Cs_UsersEntityFactory : IEntityFactory
	{
		/// <summary>Creates a new, empty Cs_UsersEntity object.</summary>
		/// <returns>A new, empty Cs_UsersEntity object.</returns>
		public virtual IEntity Create()
		{
			IEntity toReturn = new Cs_UsersEntity(new PropertyDescriptorFactory(), this);
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewCs_Users
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;

		}
		
		/// <summary>Creates a new Cs_UsersEntity instance but uses a special constructor which will set the Fields object of the new
		/// IEntity instance to the passed in fields object. Implement this method to support multi-type in single table inheritance.</summary>
		/// <param name="fields">Populated IEntityFields object for the new IEntity to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields object) IEntity object</returns>
		public virtual IEntity Create(IEntityFields fields)
		{
			IEntity toReturn = Create();
			toReturn.Fields = fields;
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewCs_UsersUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}

		/// <summary>Creates, using the generated EntityFieldsFactory, the IEntityFields object for the entity to create. This method is used by internal code to create the fields object to store fetched data. 
		/// </summary>
		/// <returns>Empty IEntityFields object.</returns>
		public virtual IEntityFields CreateFields()
		{
			return EntityFieldsFactory.CreateEntityFieldsObject(Ultimate.DAL.EntityType.Cs_UsersEntity);
		}
		
		/// <summary>Creates the hierarchy fields for the entity to which this factory belongs.</summary>
		/// <returns>IEntityFields object with the fields of all the entities in teh hierarchy of this entity or the fields of this entity if the entity isn't in a hierarchy.</returns>
		public virtual IEntityFields CreateHierarchyFields()
		{
			return this.CreateFields();
		}
		
		/// <summary>Creates the relations collection to the entity to join all targets so this entity can be fetched. </summary>
		/// <returns>null if the entity isn't in a hierarchy of type TargetPerEntity, otherwise the relations collection needed to join all targets together to fetch all subtypes of this entity and this entity itself</returns>
		public virtual IRelationCollection CreateHierarchyRelations()
		{
			return null;			
		}

		/// <summary>This method retrieves, using the InheritanceInfoprovider, the factory for the entity represented by the values passed in.</summary>
		/// <param name="fieldValues">Field values read from the db, to determine which factory to return, based on the field values passed in.</param>
		/// <param name="entityFieldStartIndexesPerEntity">indexes into values where per entity type their own fields start.</param>
		/// <returns>the factory for the entity which is represented by the values passed in.</returns>
		public virtual IEntityFactory GetEntityFactory(object[] fieldValues, Hashtable entityFieldStartIndexesPerEntity)
		{
			return this;
		}
		
		/// <summary>Creates a new entity collection for the entity of this factory.</summary>
		/// <returns>ready to use new entity collection, typed.</returns>
		public virtual IEntityCollection CreateEntityCollection()
		{
			return new Cs_UsersCollection();
		}
		
		/// <summary>returns the name of the entity this factory is for, e.g. "EmployeeEntity"</summary>
		public virtual string ForEntityName 
		{ 
			get { return "Cs_UsersEntity"; }
		}

		#region Included Code

		#endregion
	}
	
	/// <summary>Factory to create new, empty FieldEntity objects.</summary>
	[Serializable]
	public partial class FieldEntityFactory : IEntityFactory
	{
		/// <summary>Creates a new, empty FieldEntity object.</summary>
		/// <returns>A new, empty FieldEntity object.</returns>
		public virtual IEntity Create()
		{
			IEntity toReturn = new FieldEntity(new PropertyDescriptorFactory(), this);
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewField
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;

		}
		
		/// <summary>Creates a new FieldEntity instance but uses a special constructor which will set the Fields object of the new
		/// IEntity instance to the passed in fields object. Implement this method to support multi-type in single table inheritance.</summary>
		/// <param name="fields">Populated IEntityFields object for the new IEntity to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields object) IEntity object</returns>
		public virtual IEntity Create(IEntityFields fields)
		{
			IEntity toReturn = Create();
			toReturn.Fields = fields;
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewFieldUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}

		/// <summary>Creates, using the generated EntityFieldsFactory, the IEntityFields object for the entity to create. This method is used by internal code to create the fields object to store fetched data. 
		/// </summary>
		/// <returns>Empty IEntityFields object.</returns>
		public virtual IEntityFields CreateFields()
		{
			return EntityFieldsFactory.CreateEntityFieldsObject(Ultimate.DAL.EntityType.FieldEntity);
		}
		
		/// <summary>Creates the hierarchy fields for the entity to which this factory belongs.</summary>
		/// <returns>IEntityFields object with the fields of all the entities in teh hierarchy of this entity or the fields of this entity if the entity isn't in a hierarchy.</returns>
		public virtual IEntityFields CreateHierarchyFields()
		{
			return this.CreateFields();
		}
		
		/// <summary>Creates the relations collection to the entity to join all targets so this entity can be fetched. </summary>
		/// <returns>null if the entity isn't in a hierarchy of type TargetPerEntity, otherwise the relations collection needed to join all targets together to fetch all subtypes of this entity and this entity itself</returns>
		public virtual IRelationCollection CreateHierarchyRelations()
		{
			return null;			
		}

		/// <summary>This method retrieves, using the InheritanceInfoprovider, the factory for the entity represented by the values passed in.</summary>
		/// <param name="fieldValues">Field values read from the db, to determine which factory to return, based on the field values passed in.</param>
		/// <param name="entityFieldStartIndexesPerEntity">indexes into values where per entity type their own fields start.</param>
		/// <returns>the factory for the entity which is represented by the values passed in.</returns>
		public virtual IEntityFactory GetEntityFactory(object[] fieldValues, Hashtable entityFieldStartIndexesPerEntity)
		{
			return this;
		}
		
		/// <summary>Creates a new entity collection for the entity of this factory.</summary>
		/// <returns>ready to use new entity collection, typed.</returns>
		public virtual IEntityCollection CreateEntityCollection()
		{
			return new FieldCollection();
		}
		
		/// <summary>returns the name of the entity this factory is for, e.g. "EmployeeEntity"</summary>
		public virtual string ForEntityName 
		{ 
			get { return "FieldEntity"; }
		}

		#region Included Code

		#endregion
	}
	
	/// <summary>Factory to create new, empty GameEntity objects.</summary>
	[Serializable]
	public partial class GameEntityFactory : IEntityFactory
	{
		/// <summary>Creates a new, empty GameEntity object.</summary>
		/// <returns>A new, empty GameEntity object.</returns>
		public virtual IEntity Create()
		{
			IEntity toReturn = new GameEntity(new PropertyDescriptorFactory(), this);
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewGame
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;

		}
		
		/// <summary>Creates a new GameEntity instance but uses a special constructor which will set the Fields object of the new
		/// IEntity instance to the passed in fields object. Implement this method to support multi-type in single table inheritance.</summary>
		/// <param name="fields">Populated IEntityFields object for the new IEntity to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields object) IEntity object</returns>
		public virtual IEntity Create(IEntityFields fields)
		{
			IEntity toReturn = Create();
			toReturn.Fields = fields;
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewGameUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}

		/// <summary>Creates, using the generated EntityFieldsFactory, the IEntityFields object for the entity to create. This method is used by internal code to create the fields object to store fetched data. 
		/// </summary>
		/// <returns>Empty IEntityFields object.</returns>
		public virtual IEntityFields CreateFields()
		{
			return EntityFieldsFactory.CreateEntityFieldsObject(Ultimate.DAL.EntityType.GameEntity);
		}
		
		/// <summary>Creates the hierarchy fields for the entity to which this factory belongs.</summary>
		/// <returns>IEntityFields object with the fields of all the entities in teh hierarchy of this entity or the fields of this entity if the entity isn't in a hierarchy.</returns>
		public virtual IEntityFields CreateHierarchyFields()
		{
			return this.CreateFields();
		}
		
		/// <summary>Creates the relations collection to the entity to join all targets so this entity can be fetched. </summary>
		/// <returns>null if the entity isn't in a hierarchy of type TargetPerEntity, otherwise the relations collection needed to join all targets together to fetch all subtypes of this entity and this entity itself</returns>
		public virtual IRelationCollection CreateHierarchyRelations()
		{
			return null;			
		}

		/// <summary>This method retrieves, using the InheritanceInfoprovider, the factory for the entity represented by the values passed in.</summary>
		/// <param name="fieldValues">Field values read from the db, to determine which factory to return, based on the field values passed in.</param>
		/// <param name="entityFieldStartIndexesPerEntity">indexes into values where per entity type their own fields start.</param>
		/// <returns>the factory for the entity which is represented by the values passed in.</returns>
		public virtual IEntityFactory GetEntityFactory(object[] fieldValues, Hashtable entityFieldStartIndexesPerEntity)
		{
			return this;
		}
		
		/// <summary>Creates a new entity collection for the entity of this factory.</summary>
		/// <returns>ready to use new entity collection, typed.</returns>
		public virtual IEntityCollection CreateEntityCollection()
		{
			return new GameCollection();
		}
		
		/// <summary>returns the name of the entity this factory is for, e.g. "EmployeeEntity"</summary>
		public virtual string ForEntityName 
		{ 
			get { return "GameEntity"; }
		}

		#region Included Code

		#endregion
	}
	
	/// <summary>Factory to create new, empty LeagueEntity objects.</summary>
	[Serializable]
	public partial class LeagueEntityFactory : IEntityFactory
	{
		/// <summary>Creates a new, empty LeagueEntity object.</summary>
		/// <returns>A new, empty LeagueEntity object.</returns>
		public virtual IEntity Create()
		{
			IEntity toReturn = new LeagueEntity(new PropertyDescriptorFactory(), this);
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewLeague
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;

		}
		
		/// <summary>Creates a new LeagueEntity instance but uses a special constructor which will set the Fields object of the new
		/// IEntity instance to the passed in fields object. Implement this method to support multi-type in single table inheritance.</summary>
		/// <param name="fields">Populated IEntityFields object for the new IEntity to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields object) IEntity object</returns>
		public virtual IEntity Create(IEntityFields fields)
		{
			IEntity toReturn = Create();
			toReturn.Fields = fields;
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewLeagueUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}

		/// <summary>Creates, using the generated EntityFieldsFactory, the IEntityFields object for the entity to create. This method is used by internal code to create the fields object to store fetched data. 
		/// </summary>
		/// <returns>Empty IEntityFields object.</returns>
		public virtual IEntityFields CreateFields()
		{
			return EntityFieldsFactory.CreateEntityFieldsObject(Ultimate.DAL.EntityType.LeagueEntity);
		}
		
		/// <summary>Creates the hierarchy fields for the entity to which this factory belongs.</summary>
		/// <returns>IEntityFields object with the fields of all the entities in teh hierarchy of this entity or the fields of this entity if the entity isn't in a hierarchy.</returns>
		public virtual IEntityFields CreateHierarchyFields()
		{
			return this.CreateFields();
		}
		
		/// <summary>Creates the relations collection to the entity to join all targets so this entity can be fetched. </summary>
		/// <returns>null if the entity isn't in a hierarchy of type TargetPerEntity, otherwise the relations collection needed to join all targets together to fetch all subtypes of this entity and this entity itself</returns>
		public virtual IRelationCollection CreateHierarchyRelations()
		{
			return null;			
		}

		/// <summary>This method retrieves, using the InheritanceInfoprovider, the factory for the entity represented by the values passed in.</summary>
		/// <param name="fieldValues">Field values read from the db, to determine which factory to return, based on the field values passed in.</param>
		/// <param name="entityFieldStartIndexesPerEntity">indexes into values where per entity type their own fields start.</param>
		/// <returns>the factory for the entity which is represented by the values passed in.</returns>
		public virtual IEntityFactory GetEntityFactory(object[] fieldValues, Hashtable entityFieldStartIndexesPerEntity)
		{
			return this;
		}
		
		/// <summary>Creates a new entity collection for the entity of this factory.</summary>
		/// <returns>ready to use new entity collection, typed.</returns>
		public virtual IEntityCollection CreateEntityCollection()
		{
			return new LeagueCollection();
		}
		
		/// <summary>returns the name of the entity this factory is for, e.g. "EmployeeEntity"</summary>
		public virtual string ForEntityName 
		{ 
			get { return "LeagueEntity"; }
		}

		#region Included Code

		#endregion
	}
	
	/// <summary>Factory to create new, empty LocationEntity objects.</summary>
	[Serializable]
	public partial class LocationEntityFactory : IEntityFactory
	{
		/// <summary>Creates a new, empty LocationEntity object.</summary>
		/// <returns>A new, empty LocationEntity object.</returns>
		public virtual IEntity Create()
		{
			IEntity toReturn = new LocationEntity(new PropertyDescriptorFactory(), this);
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewLocation
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;

		}
		
		/// <summary>Creates a new LocationEntity instance but uses a special constructor which will set the Fields object of the new
		/// IEntity instance to the passed in fields object. Implement this method to support multi-type in single table inheritance.</summary>
		/// <param name="fields">Populated IEntityFields object for the new IEntity to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields object) IEntity object</returns>
		public virtual IEntity Create(IEntityFields fields)
		{
			IEntity toReturn = Create();
			toReturn.Fields = fields;
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewLocationUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}

		/// <summary>Creates, using the generated EntityFieldsFactory, the IEntityFields object for the entity to create. This method is used by internal code to create the fields object to store fetched data. 
		/// </summary>
		/// <returns>Empty IEntityFields object.</returns>
		public virtual IEntityFields CreateFields()
		{
			return EntityFieldsFactory.CreateEntityFieldsObject(Ultimate.DAL.EntityType.LocationEntity);
		}
		
		/// <summary>Creates the hierarchy fields for the entity to which this factory belongs.</summary>
		/// <returns>IEntityFields object with the fields of all the entities in teh hierarchy of this entity or the fields of this entity if the entity isn't in a hierarchy.</returns>
		public virtual IEntityFields CreateHierarchyFields()
		{
			return this.CreateFields();
		}
		
		/// <summary>Creates the relations collection to the entity to join all targets so this entity can be fetched. </summary>
		/// <returns>null if the entity isn't in a hierarchy of type TargetPerEntity, otherwise the relations collection needed to join all targets together to fetch all subtypes of this entity and this entity itself</returns>
		public virtual IRelationCollection CreateHierarchyRelations()
		{
			return null;			
		}

		/// <summary>This method retrieves, using the InheritanceInfoprovider, the factory for the entity represented by the values passed in.</summary>
		/// <param name="fieldValues">Field values read from the db, to determine which factory to return, based on the field values passed in.</param>
		/// <param name="entityFieldStartIndexesPerEntity">indexes into values where per entity type their own fields start.</param>
		/// <returns>the factory for the entity which is represented by the values passed in.</returns>
		public virtual IEntityFactory GetEntityFactory(object[] fieldValues, Hashtable entityFieldStartIndexesPerEntity)
		{
			return this;
		}
		
		/// <summary>Creates a new entity collection for the entity of this factory.</summary>
		/// <returns>ready to use new entity collection, typed.</returns>
		public virtual IEntityCollection CreateEntityCollection()
		{
			return new LocationCollection();
		}
		
		/// <summary>returns the name of the entity this factory is for, e.g. "EmployeeEntity"</summary>
		public virtual string ForEntityName 
		{ 
			get { return "LocationEntity"; }
		}

		#region Included Code

		#endregion
	}
	
	/// <summary>Factory to create new, empty PlayerEntity objects.</summary>
	[Serializable]
	public partial class PlayerEntityFactory : IEntityFactory
	{
		/// <summary>Creates a new, empty PlayerEntity object.</summary>
		/// <returns>A new, empty PlayerEntity object.</returns>
		public virtual IEntity Create()
		{
			IEntity toReturn = new PlayerEntity(new PropertyDescriptorFactory(), this);
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewPlayer
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;

		}
		
		/// <summary>Creates a new PlayerEntity instance but uses a special constructor which will set the Fields object of the new
		/// IEntity instance to the passed in fields object. Implement this method to support multi-type in single table inheritance.</summary>
		/// <param name="fields">Populated IEntityFields object for the new IEntity to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields object) IEntity object</returns>
		public virtual IEntity Create(IEntityFields fields)
		{
			IEntity toReturn = Create();
			toReturn.Fields = fields;
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewPlayerUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}

		/// <summary>Creates, using the generated EntityFieldsFactory, the IEntityFields object for the entity to create. This method is used by internal code to create the fields object to store fetched data. 
		/// </summary>
		/// <returns>Empty IEntityFields object.</returns>
		public virtual IEntityFields CreateFields()
		{
			return EntityFieldsFactory.CreateEntityFieldsObject(Ultimate.DAL.EntityType.PlayerEntity);
		}
		
		/// <summary>Creates the hierarchy fields for the entity to which this factory belongs.</summary>
		/// <returns>IEntityFields object with the fields of all the entities in teh hierarchy of this entity or the fields of this entity if the entity isn't in a hierarchy.</returns>
		public virtual IEntityFields CreateHierarchyFields()
		{
			return this.CreateFields();
		}
		
		/// <summary>Creates the relations collection to the entity to join all targets so this entity can be fetched. </summary>
		/// <returns>null if the entity isn't in a hierarchy of type TargetPerEntity, otherwise the relations collection needed to join all targets together to fetch all subtypes of this entity and this entity itself</returns>
		public virtual IRelationCollection CreateHierarchyRelations()
		{
			return null;			
		}

		/// <summary>This method retrieves, using the InheritanceInfoprovider, the factory for the entity represented by the values passed in.</summary>
		/// <param name="fieldValues">Field values read from the db, to determine which factory to return, based on the field values passed in.</param>
		/// <param name="entityFieldStartIndexesPerEntity">indexes into values where per entity type their own fields start.</param>
		/// <returns>the factory for the entity which is represented by the values passed in.</returns>
		public virtual IEntityFactory GetEntityFactory(object[] fieldValues, Hashtable entityFieldStartIndexesPerEntity)
		{
			return this;
		}
		
		/// <summary>Creates a new entity collection for the entity of this factory.</summary>
		/// <returns>ready to use new entity collection, typed.</returns>
		public virtual IEntityCollection CreateEntityCollection()
		{
			return new PlayerCollection();
		}
		
		/// <summary>returns the name of the entity this factory is for, e.g. "EmployeeEntity"</summary>
		public virtual string ForEntityName 
		{ 
			get { return "PlayerEntity"; }
		}

		#region Included Code

		#endregion
	}
	
	/// <summary>Factory to create new, empty RoleEntity objects.</summary>
	[Serializable]
	public partial class RoleEntityFactory : IEntityFactory
	{
		/// <summary>Creates a new, empty RoleEntity object.</summary>
		/// <returns>A new, empty RoleEntity object.</returns>
		public virtual IEntity Create()
		{
			IEntity toReturn = new RoleEntity(new PropertyDescriptorFactory(), this);
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewRole
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;

		}
		
		/// <summary>Creates a new RoleEntity instance but uses a special constructor which will set the Fields object of the new
		/// IEntity instance to the passed in fields object. Implement this method to support multi-type in single table inheritance.</summary>
		/// <param name="fields">Populated IEntityFields object for the new IEntity to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields object) IEntity object</returns>
		public virtual IEntity Create(IEntityFields fields)
		{
			IEntity toReturn = Create();
			toReturn.Fields = fields;
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewRoleUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}

		/// <summary>Creates, using the generated EntityFieldsFactory, the IEntityFields object for the entity to create. This method is used by internal code to create the fields object to store fetched data. 
		/// </summary>
		/// <returns>Empty IEntityFields object.</returns>
		public virtual IEntityFields CreateFields()
		{
			return EntityFieldsFactory.CreateEntityFieldsObject(Ultimate.DAL.EntityType.RoleEntity);
		}
		
		/// <summary>Creates the hierarchy fields for the entity to which this factory belongs.</summary>
		/// <returns>IEntityFields object with the fields of all the entities in teh hierarchy of this entity or the fields of this entity if the entity isn't in a hierarchy.</returns>
		public virtual IEntityFields CreateHierarchyFields()
		{
			return this.CreateFields();
		}
		
		/// <summary>Creates the relations collection to the entity to join all targets so this entity can be fetched. </summary>
		/// <returns>null if the entity isn't in a hierarchy of type TargetPerEntity, otherwise the relations collection needed to join all targets together to fetch all subtypes of this entity and this entity itself</returns>
		public virtual IRelationCollection CreateHierarchyRelations()
		{
			return null;			
		}

		/// <summary>This method retrieves, using the InheritanceInfoprovider, the factory for the entity represented by the values passed in.</summary>
		/// <param name="fieldValues">Field values read from the db, to determine which factory to return, based on the field values passed in.</param>
		/// <param name="entityFieldStartIndexesPerEntity">indexes into values where per entity type their own fields start.</param>
		/// <returns>the factory for the entity which is represented by the values passed in.</returns>
		public virtual IEntityFactory GetEntityFactory(object[] fieldValues, Hashtable entityFieldStartIndexesPerEntity)
		{
			return this;
		}
		
		/// <summary>Creates a new entity collection for the entity of this factory.</summary>
		/// <returns>ready to use new entity collection, typed.</returns>
		public virtual IEntityCollection CreateEntityCollection()
		{
			return new RoleCollection();
		}
		
		/// <summary>returns the name of the entity this factory is for, e.g. "EmployeeEntity"</summary>
		public virtual string ForEntityName 
		{ 
			get { return "RoleEntity"; }
		}

		#region Included Code

		#endregion
	}
	
	/// <summary>Factory to create new, empty TeamEntity objects.</summary>
	[Serializable]
	public partial class TeamEntityFactory : IEntityFactory
	{
		/// <summary>Creates a new, empty TeamEntity object.</summary>
		/// <returns>A new, empty TeamEntity object.</returns>
		public virtual IEntity Create()
		{
			IEntity toReturn = new TeamEntity(new PropertyDescriptorFactory(), this);
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewTeam
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;

		}
		
		/// <summary>Creates a new TeamEntity instance but uses a special constructor which will set the Fields object of the new
		/// IEntity instance to the passed in fields object. Implement this method to support multi-type in single table inheritance.</summary>
		/// <param name="fields">Populated IEntityFields object for the new IEntity to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields object) IEntity object</returns>
		public virtual IEntity Create(IEntityFields fields)
		{
			IEntity toReturn = Create();
			toReturn.Fields = fields;
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewTeamUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}

		/// <summary>Creates, using the generated EntityFieldsFactory, the IEntityFields object for the entity to create. This method is used by internal code to create the fields object to store fetched data. 
		/// </summary>
		/// <returns>Empty IEntityFields object.</returns>
		public virtual IEntityFields CreateFields()
		{
			return EntityFieldsFactory.CreateEntityFieldsObject(Ultimate.DAL.EntityType.TeamEntity);
		}
		
		/// <summary>Creates the hierarchy fields for the entity to which this factory belongs.</summary>
		/// <returns>IEntityFields object with the fields of all the entities in teh hierarchy of this entity or the fields of this entity if the entity isn't in a hierarchy.</returns>
		public virtual IEntityFields CreateHierarchyFields()
		{
			return this.CreateFields();
		}
		
		/// <summary>Creates the relations collection to the entity to join all targets so this entity can be fetched. </summary>
		/// <returns>null if the entity isn't in a hierarchy of type TargetPerEntity, otherwise the relations collection needed to join all targets together to fetch all subtypes of this entity and this entity itself</returns>
		public virtual IRelationCollection CreateHierarchyRelations()
		{
			return null;			
		}

		/// <summary>This method retrieves, using the InheritanceInfoprovider, the factory for the entity represented by the values passed in.</summary>
		/// <param name="fieldValues">Field values read from the db, to determine which factory to return, based on the field values passed in.</param>
		/// <param name="entityFieldStartIndexesPerEntity">indexes into values where per entity type their own fields start.</param>
		/// <returns>the factory for the entity which is represented by the values passed in.</returns>
		public virtual IEntityFactory GetEntityFactory(object[] fieldValues, Hashtable entityFieldStartIndexesPerEntity)
		{
			return this;
		}
		
		/// <summary>Creates a new entity collection for the entity of this factory.</summary>
		/// <returns>ready to use new entity collection, typed.</returns>
		public virtual IEntityCollection CreateEntityCollection()
		{
			return new TeamCollection();
		}
		
		/// <summary>returns the name of the entity this factory is for, e.g. "EmployeeEntity"</summary>
		public virtual string ForEntityName 
		{ 
			get { return "TeamEntity"; }
		}

		#region Included Code

		#endregion
	}
	
	/// <summary>Factory to create new, empty TeamPlayerEntity objects.</summary>
	[Serializable]
	public partial class TeamPlayerEntityFactory : IEntityFactory
	{
		/// <summary>Creates a new, empty TeamPlayerEntity object.</summary>
		/// <returns>A new, empty TeamPlayerEntity object.</returns>
		public virtual IEntity Create()
		{
			IEntity toReturn = new TeamPlayerEntity(new PropertyDescriptorFactory(), this);
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewTeamPlayer
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;

		}
		
		/// <summary>Creates a new TeamPlayerEntity instance but uses a special constructor which will set the Fields object of the new
		/// IEntity instance to the passed in fields object. Implement this method to support multi-type in single table inheritance.</summary>
		/// <param name="fields">Populated IEntityFields object for the new IEntity to create</param>
		/// <returns>Fully created and populated (due to the IEntityFields object) IEntity object</returns>
		public virtual IEntity Create(IEntityFields fields)
		{
			IEntity toReturn = Create();
			toReturn.Fields = fields;
			
			// __LLBLGENPRO_USER_CODE_REGION_START CreateNewTeamPlayerUsingFields
			// __LLBLGENPRO_USER_CODE_REGION_END
			return toReturn;
		}

		/// <summary>Creates, using the generated EntityFieldsFactory, the IEntityFields object for the entity to create. This method is used by internal code to create the fields object to store fetched data. 
		/// </summary>
		/// <returns>Empty IEntityFields object.</returns>
		public virtual IEntityFields CreateFields()
		{
			return EntityFieldsFactory.CreateEntityFieldsObject(Ultimate.DAL.EntityType.TeamPlayerEntity);
		}
		
		/// <summary>Creates the hierarchy fields for the entity to which this factory belongs.</summary>
		/// <returns>IEntityFields object with the fields of all the entities in teh hierarchy of this entity or the fields of this entity if the entity isn't in a hierarchy.</returns>
		public virtual IEntityFields CreateHierarchyFields()
		{
			return this.CreateFields();
		}
		
		/// <summary>Creates the relations collection to the entity to join all targets so this entity can be fetched. </summary>
		/// <returns>null if the entity isn't in a hierarchy of type TargetPerEntity, otherwise the relations collection needed to join all targets together to fetch all subtypes of this entity and this entity itself</returns>
		public virtual IRelationCollection CreateHierarchyRelations()
		{
			return null;			
		}

		/// <summary>This method retrieves, using the InheritanceInfoprovider, the factory for the entity represented by the values passed in.</summary>
		/// <param name="fieldValues">Field values read from the db, to determine which factory to return, based on the field values passed in.</param>
		/// <param name="entityFieldStartIndexesPerEntity">indexes into values where per entity type their own fields start.</param>
		/// <returns>the factory for the entity which is represented by the values passed in.</returns>
		public virtual IEntityFactory GetEntityFactory(object[] fieldValues, Hashtable entityFieldStartIndexesPerEntity)
		{
			return this;
		}
		
		/// <summary>Creates a new entity collection for the entity of this factory.</summary>
		/// <returns>ready to use new entity collection, typed.</returns>
		public virtual IEntityCollection CreateEntityCollection()
		{
			return new TeamPlayerCollection();
		}
		
		/// <summary>returns the name of the entity this factory is for, e.g. "EmployeeEntity"</summary>
		public virtual string ForEntityName 
		{ 
			get { return "TeamPlayerEntity"; }
		}

		#region Included Code

		#endregion
	}


	/// <summary>Factory to create new, empty Entity objects based on the entity type specified. Uses entity specific factory objects
	/// </summary>
	[Serializable]
	public partial class GeneralEntityFactory
	{
		/// <summary>Creates a new, empty Entity object of the type specified</summary>
		/// <param name="entityTypeToCreate">The entity type to create.</param>
		/// <returns>A new, empty Entity object.</returns>
		public static IEntity Create(EntityType entityTypeToCreate)
		{
			IEntityFactory factoryToUse = null;
			switch(entityTypeToCreate)
			{
				case Ultimate.DAL.EntityType.Aspnet_UsersEntity:
					factoryToUse = new Aspnet_UsersEntityFactory();
					break;
				case Ultimate.DAL.EntityType.Cs_UsersEntity:
					factoryToUse = new Cs_UsersEntityFactory();
					break;
				case Ultimate.DAL.EntityType.FieldEntity:
					factoryToUse = new FieldEntityFactory();
					break;
				case Ultimate.DAL.EntityType.GameEntity:
					factoryToUse = new GameEntityFactory();
					break;
				case Ultimate.DAL.EntityType.LeagueEntity:
					factoryToUse = new LeagueEntityFactory();
					break;
				case Ultimate.DAL.EntityType.LocationEntity:
					factoryToUse = new LocationEntityFactory();
					break;
				case Ultimate.DAL.EntityType.PlayerEntity:
					factoryToUse = new PlayerEntityFactory();
					break;
				case Ultimate.DAL.EntityType.RoleEntity:
					factoryToUse = new RoleEntityFactory();
					break;
				case Ultimate.DAL.EntityType.TeamEntity:
					factoryToUse = new TeamEntityFactory();
					break;
				case Ultimate.DAL.EntityType.TeamPlayerEntity:
					factoryToUse = new TeamPlayerEntityFactory();
					break;
			}
			return factoryToUse.Create();
		}		
	}
}
